package vip.ifmm.lehouse.file.service;

import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.BeansException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.PropertySource;
import vip.ifmm.lehouse.common.dto.ServerResponse;
import vip.ifmm.lehouse.file.service.api.FileService;
import vip.ifmm.lehouse.file.service.api.impl.FileServiceImpl;
import vip.ifmm.lehouse.file.service.utils.PrepareForUploaderUtil;
import vip.ifmm.lehouse.file.service.utils.UploaderUtil;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

@SpringBootApplication
@EnableDubbo
@MapperScan(value = "vip.ifmm.lehouse.file.service.dao")
@PropertySource(value = "classpath:properties/file-location.properties", encoding = "utf-8")
public class LehouseFileServiceApplication implements ApplicationContextAware {

    public static void main(String[] args) {
        SpringApplication.run(LehouseFileServiceApplication.class, args);


    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        FileService bean = applicationContext.getBean(FileService.class);
    }
}
